﻿using System;
using System.Text;
using System.Data;
using System.Data.Common;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TeamSystem.Data.UnitTesting;
using Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions;

namespace Acms.SqlStoredProcedureTests
{
    [TestClass()]
    public class Site_Put : DatabaseTestClass
    {

        public Site_Put()
        {
            InitializeComponent();
        }

        [TestInitialize()]
        public void TestInitialize()
        {
            base.InitializeTest();
        }
        [TestCleanup()]
        public void TestCleanup()
        {
            base.CleanupTest();
        }

        #region Designer support code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.DatabaseTestAction InsertTest_TestAction;
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Site_Put));
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition InsertIdOut;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition InsertId;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition InsertName;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition InsertRootUrl;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition InsertCid;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.DatabaseTestAction UpdateTest_TestAction;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition UpdateIdOut;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition UpdateId;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition UpdateName;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition UpdateRootUrl;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition UpdateCID;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.RowCountCondition UpdateRowCount;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.DatabaseTestAction CIDError_TestAction;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition InsertCIDOut;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition UpdateCIDOut;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition CIDErrorReturnValue;
            this.InsertTestData = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.DatabaseTestActions();
            this.UpdateTestData = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.DatabaseTestActions();
            this.CIDErrorData = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.DatabaseTestActions();
            InsertTest_TestAction = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.DatabaseTestAction();
            InsertIdOut = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition();
            InsertId = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition();
            InsertName = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition();
            InsertRootUrl = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition();
            InsertCid = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition();
            UpdateTest_TestAction = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.DatabaseTestAction();
            UpdateIdOut = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition();
            UpdateId = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition();
            UpdateName = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition();
            UpdateRootUrl = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition();
            UpdateCID = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition();
            UpdateRowCount = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.RowCountCondition();
            CIDError_TestAction = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.DatabaseTestAction();
            InsertCIDOut = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition();
            UpdateCIDOut = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition();
            CIDErrorReturnValue = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition();
            // 
            // InsertTestData
            // 
            this.InsertTestData.PosttestAction = null;
            this.InsertTestData.PretestAction = null;
            this.InsertTestData.TestAction = InsertTest_TestAction;
            // 
            // InsertTest_TestAction
            // 
            InsertTest_TestAction.Conditions.Add(InsertIdOut);
            InsertTest_TestAction.Conditions.Add(InsertCIDOut);
            InsertTest_TestAction.Conditions.Add(InsertId);
            InsertTest_TestAction.Conditions.Add(InsertName);
            InsertTest_TestAction.Conditions.Add(InsertRootUrl);
            InsertTest_TestAction.Conditions.Add(InsertCid);
            resources.ApplyResources(InsertTest_TestAction, "InsertTest_TestAction");
            // 
            // InsertIdOut
            // 
            InsertIdOut.ColumnNumber = 2;
            InsertIdOut.Enabled = true;
            InsertIdOut.ExpectedValue = "10";
            InsertIdOut.Name = "InsertIdOut";
            InsertIdOut.NullExpected = false;
            InsertIdOut.ResultSet = 1;
            InsertIdOut.RowNumber = 1;
            // 
            // InsertId
            // 
            InsertId.ColumnNumber = 1;
            InsertId.Enabled = true;
            InsertId.ExpectedValue = "10";
            InsertId.Name = "InsertId";
            InsertId.NullExpected = false;
            InsertId.ResultSet = 2;
            InsertId.RowNumber = 1;
            // 
            // InsertName
            // 
            InsertName.ColumnNumber = 2;
            InsertName.Enabled = true;
            InsertName.ExpectedValue = "New Test";
            InsertName.Name = "InsertName";
            InsertName.NullExpected = false;
            InsertName.ResultSet = 2;
            InsertName.RowNumber = 1;
            // 
            // InsertRootUrl
            // 
            InsertRootUrl.ColumnNumber = 3;
            InsertRootUrl.Enabled = true;
            InsertRootUrl.ExpectedValue = "localhost/NewTest";
            InsertRootUrl.Name = "InsertRootUrl";
            InsertRootUrl.NullExpected = false;
            InsertRootUrl.ResultSet = 2;
            InsertRootUrl.RowNumber = 1;
            // 
            // InsertCid
            // 
            InsertCid.ColumnNumber = 5;
            InsertCid.Enabled = true;
            InsertCid.ExpectedValue = "0";
            InsertCid.Name = "InsertCid";
            InsertCid.NullExpected = false;
            InsertCid.ResultSet = 2;
            InsertCid.RowNumber = 1;
            // 
            // UpdateTestData
            // 
            this.UpdateTestData.PosttestAction = null;
            this.UpdateTestData.PretestAction = null;
            this.UpdateTestData.TestAction = UpdateTest_TestAction;
            // 
            // UpdateTest_TestAction
            // 
            UpdateTest_TestAction.Conditions.Add(UpdateIdOut);
            UpdateTest_TestAction.Conditions.Add(UpdateCIDOut);
            UpdateTest_TestAction.Conditions.Add(UpdateId);
            UpdateTest_TestAction.Conditions.Add(UpdateName);
            UpdateTest_TestAction.Conditions.Add(UpdateRootUrl);
            UpdateTest_TestAction.Conditions.Add(UpdateCID);
            UpdateTest_TestAction.Conditions.Add(UpdateRowCount);
            resources.ApplyResources(UpdateTest_TestAction, "UpdateTest_TestAction");
            // 
            // UpdateIdOut
            // 
            UpdateIdOut.ColumnNumber = 2;
            UpdateIdOut.Enabled = true;
            UpdateIdOut.ExpectedValue = "1";
            UpdateIdOut.Name = "UpdateIdOut";
            UpdateIdOut.NullExpected = false;
            UpdateIdOut.ResultSet = 1;
            UpdateIdOut.RowNumber = 1;
            // 
            // UpdateId
            // 
            UpdateId.ColumnNumber = 1;
            UpdateId.Enabled = true;
            UpdateId.ExpectedValue = "1";
            UpdateId.Name = "UpdateId";
            UpdateId.NullExpected = false;
            UpdateId.ResultSet = 2;
            UpdateId.RowNumber = 1;
            // 
            // UpdateName
            // 
            UpdateName.ColumnNumber = 2;
            UpdateName.Enabled = true;
            UpdateName.ExpectedValue = "New Test";
            UpdateName.Name = "UpdateName";
            UpdateName.NullExpected = false;
            UpdateName.ResultSet = 2;
            UpdateName.RowNumber = 1;
            // 
            // UpdateRootUrl
            // 
            UpdateRootUrl.ColumnNumber = 3;
            UpdateRootUrl.Enabled = true;
            UpdateRootUrl.ExpectedValue = "localhost/NewTest";
            UpdateRootUrl.Name = "UpdateRootUrl";
            UpdateRootUrl.NullExpected = false;
            UpdateRootUrl.ResultSet = 2;
            UpdateRootUrl.RowNumber = 1;
            // 
            // UpdateCID
            // 
            UpdateCID.ColumnNumber = 5;
            UpdateCID.Enabled = true;
            UpdateCID.ExpectedValue = "1";
            UpdateCID.Name = "UpdateCID";
            UpdateCID.NullExpected = false;
            UpdateCID.ResultSet = 2;
            UpdateCID.RowNumber = 1;
            // 
            // UpdateRowCount
            // 
            UpdateRowCount.Enabled = true;
            UpdateRowCount.Name = "UpdateRowCount";
            UpdateRowCount.ResultSet = 3;
            UpdateRowCount.RowCount = 10;
            // 
            // CIDErrorData
            // 
            this.CIDErrorData.PosttestAction = null;
            this.CIDErrorData.PretestAction = null;
            this.CIDErrorData.TestAction = CIDError_TestAction;
            // 
            // CIDError_TestAction
            // 
            CIDError_TestAction.Conditions.Add(CIDErrorReturnValue);
            resources.ApplyResources(CIDError_TestAction, "CIDError_TestAction");
            // 
            // InsertCIDOut
            // 
            InsertCIDOut.ColumnNumber = 4;
            InsertCIDOut.Enabled = true;
            InsertCIDOut.ExpectedValue = "0";
            InsertCIDOut.Name = "InsertCIDOut";
            InsertCIDOut.NullExpected = false;
            InsertCIDOut.ResultSet = 1;
            InsertCIDOut.RowNumber = 1;
            // 
            // UpdateCIDOut
            // 
            UpdateCIDOut.ColumnNumber = 4;
            UpdateCIDOut.Enabled = true;
            UpdateCIDOut.ExpectedValue = "1";
            UpdateCIDOut.Name = "UpdateCIDOut";
            UpdateCIDOut.NullExpected = false;
            UpdateCIDOut.ResultSet = 1;
            UpdateCIDOut.RowNumber = 1;
            // 
            // CIDErrorReturnValue
            // 
            CIDErrorReturnValue.ColumnNumber = 1;
            CIDErrorReturnValue.Enabled = true;
            CIDErrorReturnValue.ExpectedValue = "-100";
            CIDErrorReturnValue.Name = "CIDErrorReturnValue";
            CIDErrorReturnValue.NullExpected = false;
            CIDErrorReturnValue.ResultSet = 1;
            CIDErrorReturnValue.RowNumber = 1;
        }

        #endregion


        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        #endregion


        [TestMethod()]
        public void InsertTest()
        {
            DatabaseTestActions testActions = this.InsertTestData;
            // Execute the pre-test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PretestAction != null), "Executing pre-test script...");
            ExecutionResult[] pretestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PretestAction);
            // Execute the test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.TestAction != null), "Executing test script...");
            ExecutionResult[] testResults = TestService.Execute(this.ExecutionContext, this.PrivilegedContext, testActions.TestAction);
            // Execute the post-test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PosttestAction != null), "Executing post-test script...");
            ExecutionResult[] posttestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PosttestAction);
        }
        [TestMethod()]
        public void UpdateTest()
        {
            DatabaseTestActions testActions = this.UpdateTestData;
            // Execute the pre-test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PretestAction != null), "Executing pre-test script...");
            ExecutionResult[] pretestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PretestAction);
            // Execute the test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.TestAction != null), "Executing test script...");
            ExecutionResult[] testResults = TestService.Execute(this.ExecutionContext, this.PrivilegedContext, testActions.TestAction);
            // Execute the post-test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PosttestAction != null), "Executing post-test script...");
            ExecutionResult[] posttestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PosttestAction);
        }
        [TestMethod()]
        public void CIDError()
        {
            DatabaseTestActions testActions = this.CIDErrorData;
            // Execute the pre-test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PretestAction != null), "Executing pre-test script...");
            ExecutionResult[] pretestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PretestAction);
            // Execute the test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.TestAction != null), "Executing test script...");
            ExecutionResult[] testResults = TestService.Execute(this.ExecutionContext, this.PrivilegedContext, testActions.TestAction);
            // Execute the post-test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PosttestAction != null), "Executing post-test script...");
            ExecutionResult[] posttestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PosttestAction);
        }
        private DatabaseTestActions InsertTestData;
        private DatabaseTestActions UpdateTestData;
        private DatabaseTestActions CIDErrorData;
    }
}
